<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			window.onload= function(){
					var input = document.getElementsByTagName('input');
					var b= (
						function(){
							var  i = 0 
							return function(){
								if(input.chexed){
									alert(i)
								}
							}
						}
					)()
			}
		</script>
	</head>
	<body>
		<form>
		  <label for="male">Male</label>
		  <input type="radio" name="sex" id="male" />
		  <br />
		  <label for="female">Female</label>
		  <input type="radio" name="sex" id="female" />
		</form>
	</body>
</html>
